<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>021-操作滚动位置.html</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}	
		.father{
			width: 300px;
			height: 300px;
			border: 1px solid #000;
			overflow: auto;
		}
		.son{
			width: 3000px;
			height: 3000px;
		}
	</style>
</head>
<body>
	<div class="father">
		<div class="son"></div>
	</div>
	<button>获取</button>
</body>
<script src="js/jquery-1.12.4.js"></script>
<script>
	$(function(){
		var oBtn = $('button')[0];
		oBtn.onclick = function(){
		console.log($('.father').scrollTop())
		console.log($('.father').scrollLeft())
		console.log($('.father').scrollTop(400))
		console.log($('.father').scrollLeft(400))
		}
		
	})
</script>
</html>